import 'dart:convert';

import 'package:bot_toast/bot_toast.dart';
import 'package:crypto/crypto.dart' as CMd5;
import 'package:url_launcher/url_launcher_string.dart';

void try_launch_url(String url) async {
  try {
    await launchUrlString(url);
  } catch (e) {
    BotToast.showText(text: "打开链接失败:${e.toString()}");
  }
}

// md5 md5加密
String md5(String str) {
  return CMd5.md5.convert(utf8.encode(str)).toString();
}
